package com.wsj.listen;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * description:测试监听类
 *
 * @author yang
 * @date 2019/4/16 14:02
 */
@Component
public class TestListener implements ApplicationListener {

  @Override
  public void onApplicationEvent(ApplicationEvent event) {
    if (event instanceof TestEvent){
      System.out.println("onApplicationEvent......");
      TestEvent testEvent = (TestEvent) event;
      testEvent.print();
    }
  }
}
